<template>
  <div class="app">
    <router-view></router-view>
    <div class="tabbar">
      <van-tabbar v-model="active">
        <van-tabbar-item
          icon="https://java.crmeb.net/static/tabBar/indexd.png"
          to="/home"
        >首页</van-tabbar-item>
        <van-tabbar-item
          to="/goods_cate"
          icon="https://java.crmeb.net/static/tabBar/cate.png"
        >分类</van-tabbar-item>
        <van-tabbar-item
          to="cart"
          icon="
        https://java.crmeb.net/static/tabBar/cart.png"
        >购物车</van-tabbar-item>
        <van-tabbar-item
          to="user"
          icon="https://java.crmeb.net/static/tabBar/user.png"
        >我的</van-tabbar-item>

      </van-tabbar>
    </div>

  </div>
</template>
<script>
export default {
  data() {
    return {
      active: 0
    }
  },
  methods:{
    gettoken(){
      let token=localStorage.token
      if(!token){
        this.$router.push("*")
      }
    }
  },
  created(){
    this.gettoken()
  }
}
</script>
<style lang="scss" scoped>
.app {
  padding-bottom: 51px;
}

  

</style>